package com.atguigu.mapper;

import com.atguigu.pojo.Employee;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @Author: liuaojun
 * @CreateTime: 2025-01-21
 * @Description:
 * @Version: 1.0
 */
@Mapper
public interface EmpReturnValueMapper {
    /**
    * @Author:liuaojun
    * @Date:2025-01-21 14:32
    * @Description:返回单个字面量
    */
    Integer empCount();

    /**
    * @Author:liuaojun
    * @Date:2025-01-21 14:36
    * @Description:返回单个POJO,更具ID查询员工信息
    */
    Employee getEmpById(Integer id);

    /**
    * @Author:liuaojun
    * @Date:2025-01-21 14:39
    * @Description:返回List类型,查询所有员工
    */
    List<Employee> selectAllEmp();

    /**
    * @Author:liuaojun
    * @Date:2025-01-21 14:41
    * @Description:返回Map类型,查询所有员工信息(测试返回多个POJO-Map)
    */
    @MapKey("empId")
    Map<Integer,Employee> selectAllEmpMap();

}
